Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

d3-time

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-time

A calculator for humanity’s peculiar conventions of time.

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.9M
decreased by-0.1%
Maintainers
1
Weekly downloads
 
Created

What is d3-time?

The d3-time npm package is a module that provides utilities for manipulating dates in JavaScript. It is part of the D3 (Data-Driven Documents) suite of tools, which are used for producing dynamic, interactive data visualizations in web browsers. d3-time is specifically designed to handle time scales, sequences, and intervals, making it a powerful tool for dealing with temporal data.

What are d3-time's main functionalities?

Time Scales

Create a time scale that maps a domain of dates to a range of numeric values. This is useful for creating time-based charts.

const timeScale = d3.scaleTime().domain([new Date(2020, 0, 1), new Date(2020, 11, 31)]).range([0, 100]);

Time Intervals

Generate an array of dates at regular intervals, such as every month between two dates. This is useful for generating axis ticks or processing data at regular time intervals.

const start = new Date(2020, 0, 1); const end = new Date(2020, 11, 31); const everyMonth = d3.timeMonth.every(1); const months = everyMonth.range(start, end);

Time Formatting

Format dates according to a specified pattern. This is useful for displaying dates in a human-readable format.

const formatTime = d3.timeFormat('%B %d, %Y'); const formatted = formatTime(new Date(2020, 0, 1));

Other packages similar to d3-time

Keywords

FAQs

Package last updated on 25 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc